#include "logindialog.h"
#include "ui_logindialog.h"

LoginDialog::LoginDialog(QWidget *parent)
    : QDialog(parent)
    , ui(new Ui::LoginDialog)
{
    ui->setupUi(this);

    ui->lineEdit_password->setEchoMode(QLineEdit::Password);
    setAttribute(Qt::WA_DeleteOnClose);//关闭的时候自动销毁
    setWindowFlag(Qt::SplashScreen);//SplashScreen 启动画面
    // setWindowFlags(windowFlags() | Qt::Window);
}

LoginDialog::~LoginDialog()
{
    delete ui;
}

void LoginDialog::on_pushButton_clicked()
{
    if(ui->lineEdit_Name->text() == "悯醨" && ui->lineEdit_password->text() == "123456")
    {
        QMessageBox::about(this,"登录信息","登录成功");
        accept();
    }
    else
    {
        QMessageBox::about(this,"登录信息","登录失败,密码或者用户名错误");
        reject();
    }
}


void LoginDialog::on_pushButton_2_clicked()
{
    QMessageBox::about(this,"登录信息","登录取消");
    reject();
}

